<!-- 个人中心 -->
<template>
    <view class="container">
        <view class="cu-form-group" style="min-height: 150rpx">
            <view class="title">证书查询</view>
        </view>
        <view class="cu-form-group">
            <view class="title">请输入证书编号：</view>
            <input v-model="code" placeholder="请输入证书编号" placeholder-style="font-size: 28rpx;color: #CCCCCC;"></input>
        </view>
        <view class="cu-form-group">
            <view class="title">请输入文件码：</view>
            <input v-model="file_code" placeholder="请输入文件码" placeholder-style="font-size: 28rpx;color: #CCCCCC;"></input>
        </view>
        <view class="searchBtn" @click="getData()">点击查询</view>

        <view class="zsList">
            <view class="bg-white">
                <view class="grid col-2 margin-bottom text-center">
                    <view style="margin-top: 20rpx;" v-for="item in imgList">
                        <view>
                            <image style="width: 336rpx;height: 280rpx;" :src="'https://huboshizb.bigchun.com'+item.img"></image>
                            <view class="name">
                                {{item.file_code}}
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                code:"",
                file_code:"",
                infoData: {},
                imgList: [
                    // {
                    //     id: 0,
                    //     img: '../../static/image/zb1.png'
                    // },
                    // {
                    //     id: 1,
                    //     img: '../../static/image/zb2.png'
                    // },
                    // {
                    //     id: 2,
                    //     img: '../../static/image/zb3.png'
                    // },
                    // {
                    //     id: 3,
                    //     img: '../../static/image/zb4.png'
                    // },
                ]
            }
        },
        onLoad() {
        this.getData()
        },
        onShow() {

        },
        computed: {

        },
        methods: {
			getData(){
                let that=this
			    that.$api.certificate({
                    code:that.code,
                    file_code:that.file_code
			    }).then(res => {
			        console.log('res',res)
			        if(res.code ==1){
			           that.imgList=res.data
			        }
                    console.log('that',that.imgList)
			    });
			},
        },
    }
</script>

<style lang="scss" scoped>
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    .container {
        padding: 0rpx 30rpx 30rpx 30rpx;
    }

    .cu-form-group {
        background-color: var(--white);
        padding: 1rpx 30rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 90rpx;
        border-bottom: 0.5px solid #eeeeee;
    }

    .cu-form-group input {
        text-align: right;
    }

    .title {
        font-size: 32rpx;
        font-family: Source Han Sans CN-Bold, Source Han Sans CN;
        font-weight: bold;
        color: #333333;
    }

    .searchBtn {
        width: 280rpx;
        height: 78rpx;
        background: #DE2415;
        border-radius: 10rpx 10rpx 10rpx 10rpx;
        opacity: 1;
        line-height: 75rpx;
        color: #FFFFFF;
        font-weight: bold;
        font-size: 30rpx;
        text-align: center;
        margin: 50rpx auto;
    }

    .grid {
        display: flex;
        flex-wrap: wrap;
    }

    .margin-bottom {
        margin-bottom: 30rpx;
    }

    .text-center {
        text-align: center;
    }

    .grid.col-2>view {
        width: 50%;
    }

    .padding {
        padding: 30rpx;
    }

    .bg-cyan {
        background-color: var(--cyan);
        color: var(--white);
    }
    .name{
        font-size: 30rpx;
        font-family: Source Han Sans CN-Regular, Source Han Sans CN;
        font-weight: 400;
        color: #333333;
        margin-top: 20rpx;
    }
</style>
